package com.reds.backend.utils.emailSender;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import com.reds.backend.utils.adminUtils.codeMaker;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Component
public class emailSender {
    @Autowired
    JavaMailSender javaMailSender;
    @Autowired
    codeMaker codeMaker = new codeMaker();
    public String sendRegisterEmail(String from, String to, String cc, String subject, String content) {
//        SimpleMailMessage simpMsg = new SimpleMailMessage();
//        String str = codeMaker.kaptchaProducer().createText();
//        System.out.println(str);
//        simpMsg.setFrom(from);
//        simpMsg.setTo(to);
//        simpMsg.setCc(cc);
//        simpMsg.setSubject(subject);
//        simpMsg.setText("您正在申请成为江西省红色文化资源管理系统管理员,您的注册验证码是:   "+str+"   请在五分钟之内完成注册,为了保证您的帐户安全，请勿向任何人提供此验证码。本邮件由系统自动发送，请勿直接回复。");
//        System.out.println(simpMsg);
//        javaMailSender.send(simpMsg);
        return "success";
    }
}
